<?php

/**
 # com_jvframwork - JV Framework
 # @version		1.5.x
 # ------------------------------------------------------------------------
 # author    Open Source Code Solutions Co
 # copyright Copyright (C) 2011 joomlavi.com. All Rights Reserved.
 # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL or later.
 # Websites: http://www.joomlavi.com
 # Technical Support:  http://www.joomlavi.com/my-tickets.html
-------------------------------------------------------------------------*/
// no direct access
defined('_JEXEC') or die('Restricted access');

class JVframeworkControllerUpdate extends JVController {
    
    function __construct($default = array()) {  
        $this->_setModel('update');
        $this->_setLink('&c=update'); 
               
        parent::__construct($default);
    }
    
    function display(){
        JRequest::setVar("view", $this->model);        
        parent::display();
    }
    
    function edit(){
        parent::displays($this->model);
    }
    
    function sendfeedback(){
        JRequest::checkToken () or jexit ( 'Invalid Token' );
        if(!$this->_model -> send()){
            $msg = ERROR_MESSAGE;
        }else{
            $msg = 'Thank for your feedback, we will check and answer soon !';
        }
    
        $this->setRedirect( $this->_link, $msg );
    }
    
    function checkupdate(){
        die($this->_model -> check());
    }
    
    function update(){
        die($this->_model -> doUpdate());
    }
    
    function updateBasetheme(){
        die($this->_model -> updateBasetheme());
    }
    
    function complete(){
        $this->setRedirect( $this->_link, 'Update successful' );
    }
    
    function error(){
        $this->setRedirect( $this->_link, 'Update error' );
    }

}
